package com.styletransfer.model;

import java.util.Date;
import java.util.List;

/**
 * 作品实体类
 * 
 * 这个类对应数据库中的work表，用于存储用户创建的作品信息。
 * 每个属性都与数据库表中的列相对应。
 */
public class Work {
    
    private Long id;             // 作品ID，主键
    private String title;        // 作品标题
    private String description;  // 作品描述
    private String originalImage; // 原始图片URL
    private String resultImage;  // 结果图片URL
    private Long userId;         // 用户ID，创建者
    private String styleId;        // 风格ID
    private Integer likeCount;   // 点赞数
    private Integer commentCount; // 评论数
    private Integer viewCount;   // 浏览次数
    private Integer isPublic;    // 是否公开：0-私有，1-公开
    private Date createTime;     // 创建时间
    private Date updateTime;     // 更新时间
    private Integer status;      // 状态：0-删除，1-正常
    
    // 非数据库字段，用于前端展示
    private User user;
    private List<String> tags;// 创建者信息
    private Style style;         // 风格信息
    private Boolean isLiked;     // 当前用户是否点赞

    public List<String> getTags() {
        return tags;
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    // 构造函数
    public Work() {
    }
    
    // Getters and Setters
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public String getTitle() {
        return title;
    }
    
    public void setTitle(String title) {
        this.title = title;
    }
    
    public String getDescription() {
        return description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
    
    public String getOriginalImage() {
        return originalImage;
    }
    
    public void setOriginalImage(String originalImage) {
        this.originalImage = originalImage;
    }
    
    public String getResultImage() {
        return resultImage;
    }
    
    public void setResultImage(String resultImage) {
        this.resultImage = resultImage;
    }
    
    public Long getUserId() {
        return userId;
    }
    
    public void setUserId(Long userId) {
        this.userId = userId;
    }
    
    public String getStyleId() {
        return styleId;
    }
    
    public void setStyleId(String styleId) {
        this.styleId = styleId;
    }
    
    public Integer getLikeCount() {
        return likeCount;
    }
    
    public void setLikeCount(Integer likeCount) {
        this.likeCount = likeCount;
    }
    
    public Integer getCommentCount() {
        return commentCount;
    }
    
    public void setCommentCount(Integer commentCount) {
        this.commentCount = commentCount;
    }
    
    public Integer getViewCount() {
        return viewCount;
    }
    
    public void setViewCount(Integer viewCount) {
        this.viewCount = viewCount;
    }
    
    public Integer getIsPublic() {
        return isPublic;
    }
    
    public void setIsPublic(Integer isPublic) {
        this.isPublic = isPublic;
    }
    
    public Date getCreateTime() {
        return createTime;
    }
    
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    
    public Date getUpdateTime() {
        return updateTime;
    }
    
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    
    public Integer getStatus() {
        return status;
    }
    
    public void setStatus(Integer status) {
        this.status = status;
    }
    
    public User getUser() {
        return user;
    }
    
    public void setUser(User user) {
        this.user = user;
    }
    
    public Style getStyle() {
        return style;
    }
    
    public void setStyle(Style style) {
        this.style = style;
    }
    
    public Boolean getIsLiked() {
        return isLiked;
    }
    
    public void setIsLiked(Boolean isLiked) {
        this.isLiked = isLiked;
    }
    
    @Override
    public String toString() {
        return "Work{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", userId=" + userId +
                ", styleId=" + styleId +
                ", likeCount=" + likeCount +
                ", commentCount=" + commentCount +
                ", viewCount=" + viewCount +
                ", isPublic=" + isPublic +
                ", status=" + status +
                '}';
    }
}
